import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/components/register'
import RegisterFirst from '@/components/registerFirst'
import RegisterSecond from '@/components/registerSecond'
import RegisterThird from '@/components/registerThird'
import Index from '@/components/index'
import UpdateIndex from '@/components/updateIndex'
import UpdatePassword from '@/components/updatePassword'
import ForgetPassword from '@/components/forgetPassword'
import RakeBack from '@/components/rakeBack'
import XFRebate from '@/components/xFRebate'
import ZSRebate from '@/components/zSRebate'
import TeamZSReward from '@/components/teamZSReward'
import TeamXFReward from '@/components/teamXFReward'
import CheckError from '@/components/checkError'
import CheckSuccess from '@/components/checkSuccess'
import AllIncome from '@/components/allIncome'
import MouthIncome from '@/components/mouthIncome'
import Personal from '@/components/personal'
import AccountManagement from '@/components/accountManagement'
import CommonProblem from '@/components/commonProblem'
import Message from '@/components/message'
import MyServices from '@/components/myServices'
import MyWallet from '@/components/myWallet'
import InviteFriends from '@/components/inviteFriends'
import InviteAgent from '@/components/inviteAgent'
import AboutUs from '@/components/aboutUs'
import ProblemDetail from '@/components/problemDetail'
import MessageDetail from '@/components/messageDetail'
import AgentDetail from '@/components/agentDetail'
import ConsumeRecord from '@/components/consumeRecord'
import Empty from '@/components/empty'
import Certificate from '@/components/certificate'
import Share from '@/components/share'
import InviteCode from '@/components/inviteCode'
import ApplyCash from '@/components/applyCash'


// 后台页面
import Main from '@/admin/main'
import Admin from '@/admin/admin'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index
    },
    {
      path: '/updateIndex',
      name: 'updateIndex',
      component: UpdateIndex
    },
    {
      path: '/updatePassword',
      name: 'updatePassword',
      component: UpdatePassword
    },
    {
      path: '/forgetPassword',
      name: 'forgetPassword',
      component: ForgetPassword
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/registerFirst',
      name: 'registerFirst',
      component:RegisterFirst
    },
    {
      path: '/registerSecond',
      name: 'registerSecond',
      component:RegisterSecond
    },
    {
      path: '/registerThird',
      name: 'registerThird',
      component:RegisterThird
    },
    {
      path: '/rakeBack',
      name: 'rakeBack',
      component: RakeBack
    },
    {
      path: '/xFRebate',
      name: 'xFRebate',
      component: XFRebate
    },
    {
      path: '/zSRebate',
      name: 'zSRebate',
      component: ZSRebate
    },
    {
      path: '/teamZSReward',
      name: 'teamZSReward',
      component: TeamZSReward
    },
    {
      path: '/teamXFReward',
      name: 'teamXFReward',
      component: TeamXFReward
    },
    {
      path: '/checkError',
      name: 'checkError',
      component: CheckError
    },
    {
      path: '/checkSuccess',
      name: 'checkSuccess',
      component: CheckSuccess
    },
    {
      path: '/allIncome/:code',
      name: 'allIncome',
      component: AllIncome
    },
    {
      path: '/mouthIncome/:code',
      name: 'mouthIncome',
      component: MouthIncome
    },
    {
      path: '/personal',
      name: 'personal',
      component: Personal
    },
    {
      path: '/accountManagement',
      name: 'accountManagement',
      component: AccountManagement
    },
    {
      path: '/commonProblem',
      name: 'commonProblem',
      component: CommonProblem
    },
    {
      path: '/message',
      name: 'message',
      component: Message
    },
    {
      path: '/myServices',
      name: 'myServices',
      component: MyServices
    },
    {
      path: '/myWallet',
      name: 'myWallet',
      component: MyWallet
    },
    {
      path: '/inviteFriends',
      name: 'inviteFriends',
      component: InviteFriends
    },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      component: AboutUs
    },
    {
      path: '/problemDetail',
      name: 'problemDetail',
      component: ProblemDetail
    },
    {
      path: '/messageDetail',
      name: 'messageDetail',
      component: MessageDetail
    },
    {
      path: '/inviteAgent',
      name: 'inviteAgent',
      component: InviteAgent
    },
    {
      path: '/agentDetail',
      name: 'agentDetail',
      component: AgentDetail
    },
    {
      path: '/consumeRecord',
      name: 'consumeRecord',
      component: ConsumeRecord
    },
    {
      path: '/empty',
      name: 'empty',
      component: Empty
    },
    {
      path: '/certificate',
      name: 'certificate',
      component: Certificate
    },
    {
      path: '/share',
      name: 'share',
      component: Share
    },
    {
      path: '/inviteCode',
      name: 'inviteCode',
      component: InviteCode
    },
    {
      path: '/applyCash',
      name: 'applyCash',
      component: ApplyCash
    },
    {
      path: '/admin',
      name: 'admin',
      component: Admin
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      children: [
        {
          path: '/detailsManagement',
          name: 'detailsManagement',          
          meta: {
            title: '镜面分销系统管理后台-经销商管理'
          },
          component: (resolve) => require(['@/admin/detailsManagement.vue'], resolve)
        },
        {
          path: '/dealerManagement',
          name: 'dealerManagement',
          meta: {
            title: '镜面分销系统管理后台-经销商管理'
          },
          component: (resolve) => require(['@/admin/dealerManagement.vue'], resolve)
        },
        // {
        //   path: '/blackManagement',
        //   name: 'blackManagement',
        //   meta: {
        //     title: '镜面分销系统管理后台-经销商管理'
        //   },
        //   component: (resolve) => require(['@/admin/blackManagement.vue'], resolve)
        // },
        {
          path: '/dealerTree',
          name: 'dealerTree',
          meta: {
            title: '镜面分销系统管理后台-经销商管理树'
          },
          component: (resolve) => require(['@/admin/dealerTree.vue'], resolve)
        },
        {
          path: '/cashManagement',
          name: 'cashManagement',
          meta: {
            title: '镜面分销系统管理后台-提现管理'
          },
          component: (resolve) => require(['@/admin/cashManagement.vue'], resolve)
        },
        {
          path: '/certManagement',
          name: 'certManagement',
          meta: {
            title: '镜面分销系统管理后台-证书管理'
          },
          component: (resolve) => require(['@/admin/certManagement.vue'], resolve)
        },       
        {
          path: '/addTemplate',
          name: 'addTemplate',
          meta: {
            title: '镜面分销系统管理后台-添加模板'
          },
          component: (resolve) => require(['@/admin/addTemplate.vue'], resolve)
        },
        {
          path: '/serviceManagement',
          name: 'serviceManagement',
          meta: {
            title: '镜面分销系统管理后台-服务管理'
          },
          component: (resolve) => require(['@/admin/serviceManagement.vue'], resolve)
        },
        {
          path: '/addService',
          name: 'addService',
          meta: {
            title: '镜面分销系统管理后台-添加服务'
          },
          component: (resolve) => require(['@/admin/addService.vue'], resolve)
        },
        {
          path: '/newGiven',
          name: 'newGiven',
          meta: {
            title: '镜面分销系统管理后台-赠送服务'
          },
          component: (resolve) => require(['@/admin/newGiven.vue'], resolve)
        },
        {
          path: '/surplusService',
          name: 'surplusService',
          meta: {
            title: '镜面分销系统管理后台-剩余服务'
          },
          component: (resolve) => require(['@/admin/surplusService.vue'], resolve)
        },
        {
          path: '/usedService',
          name: 'usedService',
          meta: {
            title: '镜面分销系统管理后台-已使用服务'
          },
          component: (resolve) => require(['@/admin/usedService.vue'], resolve)
        },
        {
          path: '/changeService',
          name: 'changeService',
          meta: {
            title: '镜面分销系统管理后台-已转移服务'
          },
          component: (resolve) => require(['@/admin/changeService.vue'], resolve)
        },
        {
          path: '/rebatePercent',
          name: 'rebatePercent',
          meta: {
            title: '镜面分销系统管理后台-返利设置'
          },
          component: (resolve) => require(['@/admin/rebatePercent.vue'], resolve)
        },
        {
          path: '/investmentOrder',
          name: 'investmentOrder',
          meta: {
            title: '镜面分销系统管理后台-招商订单'
          },
          component: (resolve) => require(['@/admin/investmentOrder.vue'], resolve)
        },
        {
          path: '/consumerOrder',
          name: 'consumerOrder',
          meta: {
            title: '镜面分销系统管理后台-消费订单'
          },
          component: (resolve) => require(['@/admin/consumerOrder.vue'], resolve)
        },
        {
          path: '/teamZhaoSReward',
          name: 'teamZhaoSReward',
          meta: {
            title: '镜面分销系统管理后台-团队招商奖励'
          },
          component: (resolve) => require(['@/admin/teamZhaoSReward.vue'], resolve)
        },
        {
          path: '/teamZhaoSRewardDetail',
          name: 'teamZhaoSRewardDetail',
          meta: {
            title: '镜面分销系统管理后台-团队招商奖励详情'
          },
          component: (resolve) => require(['@/admin/teamZhaoSRewardDetail.vue'], resolve)
        },
        {
          path: '/teamXiaoFReward',
          name: 'teamXiaoFReward',
          meta: {
            title: '镜面分销系统管理后台-团队消费奖励'
          },
          component: (resolve) => require(['@/admin/teamXiaoFReward.vue'], resolve)
        },
        {
          path: '/teamXiaoFRewardDetail',
          name: 'teamXiaoFRewardDetail',
          meta: {
            title: '镜面分销系统管理后台-团队消费奖励详情'
          },
          component: (resolve) => require(['@/admin/teamXiaoFRewardDetail.vue'], resolve)
        },
        {
          path: '/statisticsPlatform',
          name: 'statisticsPlatform',
          meta: {
            title: '镜面分销系统管理后台-平台统计'
          },
          component: (resolve) => require(['@/admin/statisticsPlatform.vue'], resolve)
        },
        {
          path: '/platformRole',
          name: 'platformRole',
          meta: {
            title: '镜面分销系统管理后台-平台用户'
          },
          component: (resolve) => require(['@/admin/platformRole.vue'], resolve)
        },
        {
          path: '/platformRoleManagement',
          name: 'platformRoleManagement',
          meta: {
            title: '镜面分销系统管理后台-平台角色'
          },
          component: (resolve) => require(['@/admin/platformRoleManagement.vue'], resolve)
        },
        {
          path: '/authorizationList',
          name: 'authorizationList',
          meta: {
            title: '镜面分销系统管理后台-权限列表'
          },
          component: (resolve) => require(['@/admin/authorizationList.vue'], resolve)
        },
        {
          path: '/controlcost',
          name: 'controlcost',
          meta: {
            title: '镜面分销系统管理后台-个人消费操作信息'
          },
          component: (resolve) => require(['@/admin/controlcost.vue'], resolve)
        },
        {
          path: '/controlLevelUp',
          name: 'controlLevelUp',
          meta: {
            title: '镜面分销系统管理后台-级别上调操作信息'
          },
          component: (resolve) => require(['@/admin/controlLevelUp.vue'], resolve)
        },
        {
          path: '/controldealer',
          name: 'controldealer',
          meta: {
            title: '镜面分销系统管理后台-经销商审核操作信息'
          },
          component: (resolve) => require(['@/admin/controldealer.vue'], resolve)
        },
        {
          path: '/controlservice',
          name: 'controlservice',
          meta: {
            title: '镜面分销系统管理后台-服务操作信息'
          },
          component: (resolve) => require(['@/admin/controlservice.vue'], resolve)
        },
        {
          path: '/controladmins',
          name: 'controladmins',
          meta: {
            title: '镜面分销系统管理后台-管理员操作信息'
          },
          component: (resolve) => require(['@/admin/controladmins.vue'], resolve)
        },
      ]
    },
  ]
})
